using System;
using System.Windows;
using System.Windows.Controls;

namespace WpfApplication1
{
    public class MyAtt : DependencyObject
    {
        public static DependencyProperty SomeAttProperty = 
            DependencyProperty.RegisterAttached("SomeAtt",
            typeof (string), 
            typeof (MyAtt), 
            new PropertyMetadata(default(string), PropertyChangedCallback));

        private static void PropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            var button = dependencyObject as Button;
           
        }

        public static string GetSomeAtt(UIElement element)
        {
            return (string) element.GetValue(SomeAttProperty);
        }

        public static void SetSomeAtt(UIElement element, string value)
        {
            element.SetValue(SomeAttProperty, value);
        }

      

    }
}